package com.dd.cloud.common.vo;

import com.dd.cloud.common.enums.ZkExceptionEnum;
import lombok.Data;

/**
 * 异常信息封装
 *
 * @author zk
 */
@Data
public class ExceptionResult {

    private int status;
    private String message;
    private Object data;
    private Long timestamp;

    public ExceptionResult(EnumResultVo em) {
        this.status = em.getCode();
        this.message = em.getMsg();
        this.timestamp = System.currentTimeMillis();
    }

    public ExceptionResult(ZkExceptionEnum em) {
        this.status = em.getCode();
        this.message = em.getMsg();
        this.timestamp = System.currentTimeMillis();
    }

    public ExceptionResult(int status, Object data, String message) {
        super();
        this.status = status;
        this.message = message;
        this.data = data;
        this.timestamp = System.currentTimeMillis();
    }

}
